/**
 * Created by Administrator on 2017/1/26.
 */
//动态添加；
$(function(){
    $(".find-qq .find-aa").hover(function(){
        var index=$(this).index();
        var dis=$(this).position().left
        $(".find-float").css({left:dis+"px"})
        switch(index){
            case 2:
                index=1;
                break;
            case 4:
                index=2;
                break;
            case 6:
                index=3;
                break;
            case 8:
                index=4;
                break;
        }

        $(".find-neirong .find-co1").eq(index).css({display:"block"}).siblings().css({display:"none"})

    })
    window.onscroll=function(){
        //500px
        var scrolltop=document.documentElement.scrollTop||document.body.scrollTop //兼容性写法
        console.log("滚轮的距离"+scrolltop)
        var wh=document.documentElement.clientHeight   //窗口的高
        console.log("窗口的高"+wh)
        var dh=document.documentElement.offsetHeight  //文档的高
        console.log("文档的高"+dh)
function find(x,y){
    $(y).css({background:""})
    $(y).eq(x).css({background:"red"});
}
        if(scrolltop>1600){
            $("#star-list").css({display:"block"})
            console.log(123)
             find(0,$("#star-list li"))
        }
        if(scrolltop>2160){
            find(1,$("#star-list li"))
        }
        if(scrolltop>2800){
            find(2,$("#star-list li"))
        }
        if(scrolltop>3330){
            find(3,$("#star-list li"))
        }
        if(scrolltop>3730){
            find(4,$("#star-list li"))
        }
        if(scrolltop>4100){
            find(5,$("#star-list li"))
        }

    };


});